mac 安装opencv 报错,解决

安装成功后,引入 cv2 报错

Python 3.6.4
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

import cv2
ceback (most recent call last):
ile ““, line 1, in
ortError: dlopen(/usr/local/Cellar/opencv/3.4.0_1/lib/python3.6/site-packages/cv2.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/jack/lib/libjack.0.dylib
eferenced from: /usr/local/opt/ffmpeg/lib/libavcodec.57.dylib
eason: image not found

最终通过下面命令解决:

​ brew install opencv3 –with-contrib –with-python3